package com.woniuxy.course.controller;


import com.woniuxy.course.entity.Knowledgepoint;
import com.woniuxy.course.service.KnowledgepointService;
import com.woniuxy.course.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author cyh
 * @since 2020-07-30
 */
@RestController
@RequestMapping("/knowledgepoint")
public class KnowledgepointController {

    @Autowired
    private KnowledgepointService knowledgepointService;
    //查询该年级知识点
    @GetMapping("getKnowledgeByGrade")
    @ResponseBody
    public R pageListAll(String grade){
        List<Knowledgepoint> knowledgepoints = knowledgepointService.getKnowledgeByGrade(grade);

        return R.ok().data("items",knowledgepoints);
    }
}

